import { useI18n } from '@/hooks/useI18n';
import type { FormItemRule } from 'element-plus';

const { t } = useI18n();
export const useValidator = () => {
  const required = (msg?: string): FormItemRule => ({ required: true, message: msg || t('validator.required'), trigger: ['blur', 'change'] });

  return {
    required
  };
};
